package com.atguigu.gulimall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @DESCRIPTION: 注册返回对象
 * @author: zr
 * @DATE: 2022/12/30 23:41
 */
@Data
public class RegisterVo {
    /**
     * 用户名
     */
    @NotEmpty(message = "用户名必须填写")
    @Length(min = 6, max = 18, message = "用户名:最小长度不能低于6位于,最大长度不能超过18位")
    private String userName;
    /**
     * 密码
     */
    @NotEmpty(message = "密码必须填写")
    @Length(min = 6, max = 18, message = "密码:最小长度不能低于6位于,最大长度不能超过18位")
    private String password;
    /**
     * 手机号
     */
    @NotEmpty(message = "手机号码必须填写")
    @Pattern(regexp = "^1([3-9])[0-9]{9}$", message = "手机号格式不正确")
    private String phone;
    /**
     * 验证码
     */
    @NotEmpty(message = "短信验证码必须填写")
    private String code;
}
